<?php

/**
 * Class teia\webdev\php\adt\DisplayableItem
 * Simple core class for displaying items
 *
 * @author Bernardo Quibiana
 * @date created: 20111003
 *
 * @date modified: 20111003
 * @modified: Bernardo Quibiana
 */

// namespace declaration: Abstract Data Types
namespace teia\webdev\php\adt;

class DisplayableItem extends Item implements IDisplayableItem {

	protected $thumbnail;
	protected $slideImage;

	protected $smallImage;
	protected $mediumImage;
	protected $largImage;

	protected $altText;
	protected $details;

	protected $link;

	protected $elemId;
	protected $elemClass;


	/**
	 * Conscrutor
	 * @param String $id
	 * @param String $name
	 * @param String $altText
	 * @param String $mediumImage
	 * @param String $link
	 * @param String $elemId
	 * @param String $elemClass
	 */
	public function __construct($id, $name, $altText, $mediumImage, $link = NULL, $elemId = NULL, $elemClass = NULL) {
		parent::__construct($id, $name);

		$this->altText = $altText;
		$this->mediumImage = $mediumImage;
		$this->link = $link;
		$this->elemId = $elemId;
		$this->elemClass = $elemClass;
	}

	public function __get($property) {
		return  $this->$property;
	}

	public function __set($property, $value) {
		return $this->$property = $value;
	}

	/**
	 * Implementation;
	 */
	public function getThumbnail() {
		if ($this->thumbnail) {
			return $this->thumbnail;
		} else {
			return $this->smallImage;
		}
	}

	/**
	 * Implementation;
	 */
	public function getSlideImage() {
		if ($this->slideImage) {
			return $this->slideImage;
		} else {
			return $this->mediumImage;
		}
	}

	/**
	 * Implementation;
	 */
	public function getSmallImage() {
		if ($this->smallImage) {
			return $this->smallImage;
		} else {
			return $this->thumbnail;
		}
	}

	/**
	 * Implementation;
	 */
	public function getMediumImage() {
		if ($this->mediumImage) {
			return $this->mediumImage;
		} else {
			return $this->slideImage;
		}
	}

	/**
	 * Implementation;
	 */
	public function getLargeImage() {
		return $this->largImage;
	}

	/**
	 * Implementation;
	 */
	public function getAltText() {
		return $this->altText;
	}

	/**
	 * Implementation;
	 */
	public function getElementId() {
		return $this->elemId;
	}

	/**
	 * Implementation;
	 */
	public function getElementClass() {
		return $this->elemClass;
	}

	/**
	 * Implementation;
	 */
	public function getDetails() {
		return $this->details;
	}

	/**
	 * Implementation;
	 */
	public function generate($context) {

	}

	/**
	 * Implemantion;
	 */
	public function display($context) {
		echo $this->generate($context);	
	}
}

?>